import fs from 'fs'
import { resolve } from 'path'

const p1 = new Promise((resolve, seject) => {
    fs.readFile('./txt/a.txt', 'utf8', (err, data) => {
        resolve(data) //不考虑失败
    })
})

const p2 = new Promise((resolve, seject) => {
    fs.readFile('./txt/b.txt', 'utf8', (err, data) => {
        resolve(data) //不考虑失败
    })
})

const p3 = new Promise((resolve, seject) => {
    fs.readFile('./txt/c.txt', 'utf8', (err, data) => {
        resolve(data) //不考虑失败
    })
})



p1.then(res=>{
    console.log(res)
    // 返回一个
    return p2
}).then(res=>{
    console.log(res)
    return p3
}).then(res=>{
    console.log(res)
})